//路由文件
import React from 'react';
//1.引入路由的依赖
import {Route,Link,BrowserRouter} from 'react-router-dom';
//2.引入页面
import { Menu } from 'antd';
import Main from '../pages/main';
import Mask from '../pages/zzl';
import Good from '../pages/ldm';
import './router.scss'
import Xianzhelt from '../pages/xianzhelt'



class App extends React.Component{
	state = {
		current: 'mail',
	  };
	
	  handleClick = e => {
		// console.log('click ', e);
		this.setState({ current: e.key });
	  };
	render(){
	const { current } = this.state;
	return(
	<BrowserRouter>
		<div className="HomePageRouting"> 
			<Menu onClick={this.handleClick} selectedKeys={[current]}   mode="horizontal">
				<Menu.Item key="app" >
					<Link to="/mask">前端</Link>
				</Menu.Item>
				<Menu.Item key="mail" >
					<Link to="/">首页</Link>
				</Menu.Item>
				<Menu.Item key="cctx" >
					<Link to="/good">后端</Link>
				</Menu.Item>
			</Menu>
		</div>
		<div>
			<Route path="/" exact={true} component={Main} />
			<Route path="/mask" component={Mask} />
			<Route path="/good" component={Good} />
			<Route path="/Xianzhelt" component={Xianzhelt} />
		</div>
	</BrowserRouter>
	)
}}

export default App;